﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.StockContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.StockContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.StockContext
{
    /// <summary>
    /// 库存单据明细仓储实现
    /// </summary>
    public class StockOrderDetailRepository : EFEntityRepositoryProvider<StockOrderDetail>, IStockOrderDetailRepository
    {
        #region # 获取库存单据明细列表 —— ICollection<StockOrderDetail> Find(Guid stockOrderId)
        /// <summary>
        /// 获取库存单据明细列表
        /// </summary>
        /// <param name="stockOrderId">库存单据Id</param>
        /// <returns>库存单据明细列表</returns>
        public ICollection<StockOrderDetail> Find(Guid stockOrderId)
        {
            IQueryable<StockOrderDetail> details = base.Find(x => x.StockOrder.Id == stockOrderId);

            return details.ToList();
        }
        #endregion
    }
}
